function submitModify(id) {
	editor_intro.sync();
	editor_shortintro.sync();
	editor_others.sync();
	editor_service.sync();
	var type = $.trim($("#type").val());
	var company = $.trim($("#company").val());
	var sup = $.trim($("#sup").val());
	var name = $.trim($("#name").val());
	var pic = $.trim($("#pic").val());
	var code = $.trim($("#code").val());
	var shortName = $.trim($("#shortName").val());
	var begin = $.trim($("#begin").val());
	var end = $.trim($("#end").val());
	var price = $.trim($("#price").val());
	var settlePrice = $.trim($("#settlePrice").val());
	var quota = $.trim($("#quota").val());
	var min = $.trim($("#min").val());
	var max = $.trim($("#max").val());
	var time = $.trim($("#time").val());
	var timeUnit = $.trim($("#timeUnit").val());
	var timeDesc = $.trim($("#timeDesc").val());
	var shortIntro = $.trim($("#shortIntro").val());
	var intro = $.trim($("#intro").val());
	var service = $.trim($("#service").val());
	var others = $.trim($("#others").val());
	var status = $.trim($("#status").val());
	$.ajax({
		type : 'POST',
		url : "/product/modify.json",
		dataType : "json",
		data : {
			id : id,
			type : type,
			company : company,
			sup : sup,
			name : name,
			pic : pic,
			code : code,
			shortName : shortName,
			begin : begin,
			end : end,
			price : price,
			settlePrice : settlePrice,
			quota : quota,
			min : min,
			max : max,
			time : time,
			timeUnit : timeUnit,
			timeDesc : timeDesc,
			shortIntro : shortIntro,
			service : service,
			intro : intro,
			others : others,
			status : status
		},
		success : function(data) {
			if (data && data.ok) {
				alert("修改成功！");
				//window.location.reload();
			} else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("修改失败！");
		}
	});
}

function submitCreate() {
	editor_intro.sync();
	editor_shortintro.sync();
	editor_others.sync();
	editor_service.sync();
	var type = $.trim($("#type").val());
	var company = $.trim($("#company").val());
	var sup = $.trim($("#sup").val());
	var name = $.trim($("#name").val());
	var pic = $.trim($("#pic").val());
	var code = $.trim($("#code").val());
	var shortName = $.trim($("#shortName").val());
	var begin = $.trim($("#begin").val());
	var end = $.trim($("#end").val());
	var price = $.trim($("#price").val());
	var settlePrice = $.trim($("#settlePrice").val());
	var quota = $.trim($("#quota").val());
	var min = $.trim($("#min").val());
	var max = $.trim($("#max").val());
	var time = $.trim($("#time").val());
	var timeUnit = $.trim($("#timeUnit").val());
	var timeDesc = $.trim($("#timeDesc").val());
	var shortIntro = $.trim($("#shortIntro").val());
	var intro = $.trim($("#intro").val());
	var service = $.trim($("#service").val());
	var others = $.trim($("#others").val());
	var status = $.trim($("#status").val());
	jQuery.ajax({
		type : 'POST',
		url : "/product/add.json",
		dataType : "json",
		data : {
			type : type,
			company : company,
			sup : sup,
			name : name,
			pic : pic,
			code : code,
			shortName : shortName,
			begin : begin,
			end : end,
			price : price,
			settlePrice : settlePrice,
			quota : quota,
			min : min,
			max : max,
			time : time,
			timeUnit : timeUnit,
			timeDesc : timeDesc,
			shortIntro : shortIntro,
			service : service,
			intro : intro,
			others : others,
			status : status
		},
		success : function(data) {
			if (data && data.ok) {
				alert("添加成功！");
				window.location.reload();
			} else {
				alert(data.msg);
			}
		},
		error : function(error) {
			alert("添加失败！");
		}
	});
}